package com.pro.springbootshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pro.springbootshop.entity.Seller;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface SellerMapper extends BaseMapper<Seller> {
    @Select("select * from seller where seller_id=#{sellerId} and seller_pw=#{sellerPw}")
    Seller sellerLogin(String sellerId, String sellerPw);
    @Select("select * from seller where seller_id=#{sellerId}")
    Seller sellerSearch(String sellerId);
    @Update("update seller set seller_pw = #{sellerPw} where seller_id=#{sellerId}")
    void updatePassword(String sellerPw,String sellerId);
    @Select("select * from seller where seller_id!='admin' limit #{pageNo},#{limit}")
    List<Seller> adminGetSeller(int pageNo, int limit);
    @Delete("delete from seller where seller_id=#{sellerId}")
    int adminDeleteSeller(String sellerId);
}
